package com.ouc.pampas;

import com.google.common.collect.Sets;
import java.io.Serializable;
import java.util.Set;

public class Auths
  implements Serializable
{
  private static final long serialVersionUID = 6554743011603841486L;
  private Set<ProtectedAuth> protectedList;
  private Set<WhiteAuth> whiteList;
  
  public String toString()
  {
    return "Auths(protectedList=" + getProtectedList() + ", whiteList=" + getWhiteList() + ")";
  }
  
  public Set<ProtectedAuth> getProtectedList()
  {
    return this.protectedList;
  }
  
  public void setProtectedList(Set<ProtectedAuth> protectedList)
  {
    this.protectedList = protectedList;
  }
  
  public Set<WhiteAuth> getWhiteList()
  {
    return this.whiteList;
  }
  
  public void setWhiteList(Set<WhiteAuth> whiteList)
  {
    this.whiteList = whiteList;
  }
  
  public void merge(Auths mergedAuths)
  {
    if ((mergedAuths.getProtectedList() != null) && (!mergedAuths.getProtectedList().isEmpty()))
    {
      if (this.protectedList == null) {
        this.protectedList = Sets.newHashSet();
      }
      this.protectedList.addAll(mergedAuths.getProtectedList());
    }
    if ((mergedAuths.getWhiteList() != null) && (!mergedAuths.getWhiteList().isEmpty()))
    {
      if (this.whiteList == null) {
        this.whiteList = Sets.newHashSet();
      }
      this.whiteList.addAll(mergedAuths.getWhiteList());
    }
  }
}
